<template>
  <div class="container">
    <text class="big-title">示例</text>
    <div class="content">
      <text style="font-size: 26px;">默认情况下，页面的宽度是750px，meta api修改页面的宽度为600px，则页面显示效果如下：</text>
      <div class="div600">
        <text class="div-text">width = 600px</text>
      </div>
      <div class="div300">
        <text class="div-text">width = 300px</text>
      </div>
    </div>
    <text class="big-title">文档</text>
    <div class="button" @click="showDoc"><text class="btn-text">点击查看文档</text></div>
  </div>
</template>

<style scoped>
.container {
  padding: 10px;
}
.content {
  flex-direction: column;
}
.big-title {
  color: black;
  font-size: 50px;
  font-weight: bold;
  margin-bottom: 20px;
  margin-top: 20px;
}
.button {
  height: 60px;
  justify-content: center;
  opacity: 1.0;
}
.div600 {
  width: 600px;
  height: 60px;
  justify-content: center;
  align-items: center;
  background-color: #6699FF;
  margin-top: 5px;
  margin-bottom: 5px;
}
.div300 {
  width: 300px;
  height: 60px;
  justify-content: center;
  align-items: center;
  background-color: #6699FF;
  margin-top: 5px;
  margin-bottom: 5px;
}
.div-text {
  font-size: 30px;
  color: white;
}
.button:active {
  opacity: 0.6;
}
.btn-text {
  font-size: 30px;
  color: blue;
}
</style>

<script>
  import utils from '../utils.js';
  let meta = weex.requireModule('meta');
  let navigator = weex.requireModule('navigator');
  meta.setViewport({
    width: 600
  })
  export default {
    data: {

    },
    methods: {
      showDoc() {
        navigator.push({
          url: utils.getDocDetailUrl(weex.config.bundleUrl),
          animated: true
        });
      }
    }
  }
</script>
